//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop


#include "FrmSpoud.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormSpoud *FormSpoud;

//--> controllers
#include "IStudentDbSavingController.h"
#include "StudentDbSavingController.h"
#include "IStudentAddressSaver.h"
#include "StudentAddressSaver.h"
#include "DatabaseConnectionInformer.h"

//--> create controllers
IStudentDbSavingController *StudentDbSaver ;
IStudentFatherSaver *StudentFatherSaver
IDatabaseConnectionInformer *iform;


//---------------------------------------------------------------------------
__fastcall TFormSpoud::TFormSpoud(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormSpoud::RadioButton1Click(TObject *Sender)
{
this->GroupBox1->Visible=true;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton2Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=true;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton3Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=true;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton4Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=true;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------


void My_update_form(TFormSpoud *mform) {
/*
mform->Edit8->Text=.onoma;
mform->Edit9->Text=.eponimo;
mform->Edit10->Text=.lessons;
mform->Edit11->Text=.didaktra;
mform->Edit7->Text=.hasbrothers_id;
mform->Edit1->Text=.old_odio_name;
mform->Edit2->Text =.town_odio;
mform->Edit4->Text= .vathmos_lesson;
mform->Edit3->Text= .title_lesson;
mform->Edit5->Text = .etos_katat;
mform->Edit6->Text= .vathm_katat;
*/

}


void __fastcall TFormSpoud::FormCreate(TObject *Sender)
{
My_update_form(this);

this->GroupBox1->Visible=true;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=false;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::RadioButton5Click(TObject *Sender)
{
this->GroupBox1->Visible=false;
this->GroupBox2->Visible=false;
this->GroupBox3->Visible=false;
this->GroupBox4->Visible=false;
this->GroupBox5->Visible=true;
}
//---------------------------------------------------------------------------

void __fastcall TFormSpoud::Button2Click(TObject *Sender)
{

iform=new IDatabaseConnectionInformer();
//orismos tis vasis pu prei na anoiksei
iform->setDbName("DataBase");   //prepei na deixnei sto onoma tis vasis dedomenwn
iform->setUsername("AdminUserDataBaseName"); //to onoma tou user Database
iform->setPassword("Password"); //kwdikos tou xristi

//apothikefsi dedomenwn stin vasi (meso controller -IDatabaseConnectionInformer- )




/*  //kaleite o savecontroller gia spoudasti
.onoma=Edit8->Text;
.eponimo=Edit9->Text;

.lessons=Edit10->Text;
.didaktra;
.hasbrothers_id;

.old_odio_name= Edit1->Text;
.town_odio =Edit2->Text;
.vathmos_lesson= Edit4->Text;
.title_lesson= Edit3->Text;

.etos_katat =Edit5->Text;
.vathm_katat =Edit6->Text;

     */

}




//---------------------------------------------------------------------------

void __fastcall TFormSpoud::Button1Click(TObject *Sender)
{
//algorithmos ipologismou didaktrwn

}
//---------------------------------------------------------------------------
